require "Battle/Buff/BaseBuffEffect"

BuffEffect11 = BaseBuffEffect:new();
BuffEffect11.__index = BuffEffect11;

function BuffEffect11:new()
    local object =  BaseBuffEffect:new();
    setmetatable(object, BuffEffect11);
    return object;
end

function BuffEffect11:action(fight,buff,...)
    local values = decodeJsonStrToTabel(buff.buffBean.f_BuffEffectValue);
    -- 计算值
    local value = Mathf.Floor(FighterAttributeManager.getFightAttr(buff.source, values[1]) * values[3]/ EnumConst.TEN_THOUSANDTH);

    --dataTable.PrintTable(buff.value);
    --buff.value["attributes"] = buff.value["attributes"] or {};
    buff.value[values[2]] = value;

    fightLog("[EFFECT]Fighter "..buff.target.fighterId.." Buff"..buff.modelId.." 触发属性转化，属性【"..values[1].."】转化为【"..values[2].."】数值："..value);
    return BaseBuffEffect:action(fight, buff, ...);
end
